﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SAR
{
    public partial class CanShuFenXi10
    {
        public CanShuFenXi10()
        {
            this.InitializeComponent();
        }

        private void startCalcuBtn_SARBigBtnClick(object sender, MouseButtonEventArgs e)
        {
            this.subfieldBar4.IsEnabled = true;
            this.TableGrid1.Visibility = this.TableGrid2.Visibility = this.TableGrid3.Visibility = Visibility.Collapsed;
            this.TableGrid4.Visibility = Visibility.Visible;
            this.subfieldBar4.SARIsUnfolded = true;
            this.subfieldBar1.SARIsUnfolded = this.subfieldBar2.SARIsUnfolded = this.subfieldBar3.SARIsUnfolded = false;
        }

        private void subfieldBar1_SARClick(object sender, MouseButtonEventArgs e)
        {
            if (this.subfieldBar1.SARIsUnfolded)
            {
                this.TableGrid1.Visibility = Visibility.Collapsed;
            }else
            {
                this.TableGrid2.Visibility = this.TableGrid3.Visibility = this.TableGrid4.Visibility = Visibility.Collapsed;
                this.subfieldBar2.SARIsUnfolded = this.subfieldBar3.SARIsUnfolded = this.subfieldBar4.SARIsUnfolded = false;
                this.TableGrid1.Visibility = Visibility.Visible;
            }
            this.subfieldBar1.SARIsUnfolded = !this.subfieldBar1.SARIsUnfolded;
        }

        private void subfieldBar2_SARClick(object sender, MouseButtonEventArgs e)
        {
            if (this.subfieldBar2.SARIsUnfolded)
            {
                this.TableGrid2.Visibility = Visibility.Collapsed;
            }
            else
            {
                this.TableGrid1.Visibility = this.TableGrid3.Visibility = this.TableGrid4.Visibility = Visibility.Collapsed;
                this.subfieldBar1.SARIsUnfolded = this.subfieldBar3.SARIsUnfolded = this.subfieldBar4.SARIsUnfolded = false;
                this.TableGrid2.Visibility = Visibility.Visible;
            }
            this.subfieldBar2.SARIsUnfolded = !this.subfieldBar2.SARIsUnfolded;

        }

        private void subfieldBar3_SARClick(object sender, MouseButtonEventArgs e)
        {
            if (this.subfieldBar3.SARIsUnfolded)
            {
                this.TableGrid3.Visibility = Visibility.Collapsed;
            }
            else
            {
                this.TableGrid1.Visibility = this.TableGrid2.Visibility = this.TableGrid4.Visibility = Visibility.Collapsed;
                this.subfieldBar1.SARIsUnfolded = this.subfieldBar2.SARIsUnfolded = this.subfieldBar4.SARIsUnfolded = false;
                this.TableGrid3.Visibility = Visibility.Visible;
            }
            this.subfieldBar3.SARIsUnfolded = !this.subfieldBar3.SARIsUnfolded;
        }

        private void subfieldBar4_SARClick(object sender, MouseButtonEventArgs e)
        {
            if (this.subfieldBar4.SARIsUnfolded)
            {
                this.TableGrid4.Visibility = Visibility.Collapsed;
            }
            else
            {
                this.TableGrid1.Visibility = this.TableGrid3.Visibility = this.TableGrid2.Visibility = Visibility.Collapsed;
                this.subfieldBar1.SARIsUnfolded = this.subfieldBar3.SARIsUnfolded = this.subfieldBar2.SARIsUnfolded = false;
                this.TableGrid4.Visibility = Visibility.Visible;
            }
            this.subfieldBar4.SARIsUnfolded = !this.subfieldBar4.SARIsUnfolded;

        }


    }
}